#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''
Created on 3 jul 2011

@author: Joakim Lindskog

Copyright (c) 2011 Joakim Lindskog

This file is part of MyGarden.

    MyGarden is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    MyGarden is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with MyGarden.  If not, see <http://www.gnu.org/licenses/>.
'''
from gardenbase import gardensprite
from cocos.director import director
from pyglet import window

class Tool(gardensprite.GardenSprite):
    '''
    classdocs
    '''

    def __init__(self, image):
        '''
        Constructor
        '''
        super(Tool, self).__init__(image)
        self.target = None
    
    def use(self, bed, x, y, button, modifiers):
        '''
        Starts the use of this tool
        
        @param bed: the bed this tool is used on
        @type bed: Bed
        
        @param x: the x-coordinate where this tool is used
        @type x: float
        
        @param y: the y-coordinate where this tool is used
        @type y: float
        
        @param button: the clicked button
        @type button: int
        
        @param modifiers: modifiers for mouse click
        @type modifiers: int
        '''
        pass
    
    def cancel(self):
        '''
        Cancels the use of this tool
        '''
        pass
    
    def get_cursor(self):
        '''
        @return: the cursor used with this tool
        @rtype: MouseCursor
        '''
        return director.interpreter_locals["director"].window.get_system_mouse_cursor(window.BaseWindow.CURSOR_DEFAULT)
    
    def get_mouse_info_image(self):
        '''
        @return: the mouse info image used with this tool
        @rtype: Gardensprite
        '''
        return None